package com.wanjia.estate.pojo.print;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Objects;

@Data
@EqualsAndHashCode(callSuper = true)
public class DoorStatusResponse extends CommonResponse {

    private DoorStatus data;

    @Data
    public static class DoorStatus implements Serializable {
        @JSONField(name = "Code")
        private Integer code;
        @JSONField(name = "Message")
        private String message;

        public boolean isClosed() {
            return Objects.equals(code, 2) && Objects.equals(message, "门关闭");
        }
    }
}
